#include"list.h"

void print(SLTNode* phead)
{
	SLTNode* cur = phead;
	while (cur != NULL)
	{
		printf("%d->", cur->data);
		cur = cur->next;
	}
	printf("NULL\n");
}

void pushfront(SLTNode** pphead, Datatype x)
{
	SLTNode* node = (SLTNode*)malloc(sizeof(SLTNode));
	if (node == NULL)
	{
		perror("malloc fail\n");
	}
	node->data = x;
	node->next = NULL;

	node->next = *pphead;
	*pphead = node;
}